import 'dart:convert';

EvaluationRandomBookResult evaluationRandomBookResultFromJson(String str) =>
    EvaluationRandomBookResult.fromJson(json.decode(str));
String evaluationRandomBookResultToJson(EvaluationRandomBookResult data) =>
    json.encode(data.toJson());
List<EvaluationBook> evaluationBookFromJson(String str) =>
    List<EvaluationBook>.from(
        json.decode(str).map((x) => EvaluationBook.fromJson(x)));
String evaluationBookToJson(List<EvaluationBook> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class EvaluationRandomBookResult {
  EvaluationRandomBookResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  EvaluationBook? result;

  factory EvaluationRandomBookResult.fromJson(Map<String, dynamic> json) =>
      EvaluationRandomBookResult(
        status: json["status"],
        message: json["message"],
        result:json["result"]!=null ? EvaluationBook.fromJson(json["result"]) : null,
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class EvaluationBook {
  EvaluationBook({
    this.image,
    this.bookCode,
    this.descriptionTraditional,
    this.level,
    this.series,
    this.topics,
    this.description,
    this.categories,
    this.title,
    this.titleTraditional,
    this.bookId,
    this.bookContentLink,
    this.viewMode,
  });

  String? image;
  String? bookCode;
  String? descriptionTraditional;
  int? level;
  List<String>? series;
  List<String>? topics;
  String? description;
  List<dynamic>? categories;
  String? title;
  String? titleTraditional;
  String? bookId;
  String? bookContentLink;
  String? viewMode;

  factory EvaluationBook.fromJson(Map<String, dynamic> json) => EvaluationBook(
        image: json["image"],
        bookCode: json["bookCode"],
        descriptionTraditional: json["descriptionTraditional"],
        level: json["level"],
        series: json["series"] != null
            ? List<String>.from(json["series"].map((x) => x))
            : null,
        topics: json["topics"] != null
            ? List<String>.from(json["topics"].map((x) => x))
            : null,
        description: json["description"],
        categories: json["categories"] != null
            ? List<dynamic>.from(json["categories"].map((x) => x))
            : null,
        title: json["title"],
        titleTraditional: json["titleTraditional"],
        bookId: json["bookId"],
        bookContentLink: json["bookContentLink"],
        viewMode: json["viewMode"],
      );

  Map<String, dynamic> toJson() => {
        "image": image,
        "bookCode": bookCode,
        "descriptionTraditional": descriptionTraditional,
        "level": level,
        "series":
            series != null ? List<dynamic>.from(series!.map((x) => x)) : null,
        "topics":
            topics != null ? List<dynamic>.from(topics!.map((x) => x)) : null,
        "description": description,
        "categories": categories != null
            ? List<dynamic>.from(categories!.map((x) => x))
            : null,
        "title": title,
        "titleTraditional": titleTraditional,
        "bookId": bookId,
        "bookContentLink": bookContentLink,
        "viewMode": viewMode,
      };
}
